<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style type="text/css">
        canvas{
            border: 1px solid red;
        }
    </style>
</head>
<body>
<canvas width="600" height="600" id="can">您的浏览器不支持画布</canvas>
<script type="text/javascript">
    var can=document.getElementById("can");
    var pen=can.getContext("2d");
    pen.clearRect(0,0,can.width,can.height);

//    var raduim=20;//定义一个半径
//     pen.beginPath();
//    pen.arc(300,300,raduim,0,Math.PI*2,false);
//    pen.closePath();
//    pen.stroke();
//
//
//    pen.beginPath();
//    var r2=raduim+30;
//    pen.arc(300,300,r2,0,Math.PI*2,false);
//    pen.closePath();
//    pen.stroke();
    for(var i=10;i<=100;i+=20){
           pen.beginPath();
           pen.arc(300,300,i,0,Math.PI*2,false);
           var a=2*i;
           var b=0.2*i;
           var c=i;
           pen.fillStyle="rgb("+a+","+b+","+c+")";
           pen.fill();
           pen.closePath();
           pen.stroke();
    }





</script>
</body>
</html>